#include <iostream>
#include <cmath>

int main()
{
	const int n =10;
	double sum=0, mul=1,x=0;
	int tmp=0, tmp1=0,k=0;
	double mas[n]= {-1, 2, 5, 6.13, -9.1, -4.3, 13, -6.4, 22, -11};
	for(int i=0; i<n-1; i++)
	{    if(mas[tmp1]<mas[i+1])
			tmp1= i+1 ;
		
		 if(mas[tmp]>mas[i+1])
			 tmp= i+1;
		 if(mas[i]<0)
          sum=sum+mas[i];
     }
	if(mas[n-1]<0)
		sum=sum+mas[n-1];
	if((tmp1< tmp) && ((tmp-tmp1)!=1))
		for(int j=tmp1+1; j<tmp; j++)
			mul=mul*mas[j];
	else if((tmp1> tmp) && ((tmp1-tmp)!=1))
		for(int j=tmp+1; j<tmp1; j++)
			mul=mul*mas[j];
	else
		mul=0;
	for( int i=0; i < n; i++)
	{	k=i; x=mas[i];
		for( int j=i+1; j < n; j++)
		{if (  mas[j] < x )
		k=j; x=mas[j];}
		mas[k] = mas[i]; 
		mas[i] = x;
	}
	std::cout<<"sum: "<<sum<<'\n'<<"mul: "<<mul<<std::endl;
	for(int i=0; i<n; i++)
	{std::cout<<mas[i]<<'\t';}
	return 0;
}
